package com.wntime.simulator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
@NoArgsConstructor
@TableName(value = "simulator")
public class Simulator implements Serializable {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(value = "\"name\"")
    private String name;

    @TableField(value = "\"type\"")
    private String type;

    @TableField(value = "port")
    private Integer port;

    @TableField(value = "pool_size")
    private Integer poolSize;

    @TableField(value = "over_tcp")
    private Boolean overTcp;

    @TableField(value = "uint_id")
    private Integer uintId;

    private static final long serialVersionUID = 1L;

    public com.wntime.simulator.device.Simulator toSimulator() {
        com.wntime.simulator.device.Simulator s = new com.wntime.simulator.device.Simulator();
        s.setName(this.getName());
        s.setId(this.getId()+"");
        s.setType(this.getType());
        s.setPort(this.getPort());
        s.setPoolSize(this.getPoolSize());
        s.setOverTcp(this.getOverTcp());
        s.setUintId(this.getUintId());
        return s;
    }
}